# syntax=docker/dockerfile:1
FROM centos:centos7.9.2009

ADD jdk-8u311-linux-x64.tar.gz /usr/local/
WORKDIR /app

RUN pwd

COPY target/docker_demo_connect_database-0.0.1-SNAPSHOT.jar /app/docker_demo_connect_database-0.0.1-SNAPSHOT.jar
COPY src/main/resources/application.properties /app/application.properties
COPY src/main/resources/application-test.properties /app/application-test.properties

#jdk enviroment
ENV JAVA_HOME=/usr/local/jdk1.8.0_311
ENV JRE_HOME=/usr/local/jdk1.8.0_311/jre
ENV CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
ENV PATH=$JAVA_HOME/bin:$PATH

# EXPOSE 8081
CMD ["java","-jar","docker_demo_connect_database-0.0.1-SNAPSHOT.jar"]
